package mx.itesm.temperaturas;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class Temperatura extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_temperatura);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_temperatura, menu);
        return true;
    }
    public void hacerConversion(View v){
    	EditText etf= (EditText) findViewById(R.id.tfFahrenheit);
    	EditText etc= (EditText) findViewById(R.id.tfCelsius);
    	String cadf= etf.getText().toString();
    	double gf=Double.parseDouble(cadf);
    	double gc=(5/9.0)*(gf-32);
    	etc.setText(gc+"");
    }
    public void mostrarAcercaDe(View v){
    	Intent intencion= new Intent(this,AcercaDe.class);
    	this.startActivity(intencion);
    }
}
